﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Kyers._50kweb.ActionServices.User;
using _50kWebSite.Models;
using Kyers._50kweb.Helper;
namespace _50kWebSite.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/
        readonly IUserActionServices _UserService;

        public HomeController(IUserActionServices user)
        {
            this._UserService = user;
        }

        public ActionResult Index()
        {
            var data = _UserService.GetAll();
            List<UserDataModel> model = new List<UserDataModel>();
            model = data.ToList().ConvertAll(x => new UserDataModel() {
                username =x.username,id=x.id,guidid =x.guidid
            });
            return View(model);
        }
        public ActionResult view2()
        {
            return View("view2");
        }

    }
}
